package com.wzh.controll;

import com.wzh.pojo.Po.Act;
import com.wzh.pojo.Po.Classinfo;
import com.wzh.pojo.Req.ClassinfoReq;
import com.wzh.service.Mailser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/email")
public class Mainnotice {
	@Autowired
	private Mailser mailser;

	@PostMapping("/send")
	public result tosend(@RequestBody Act act){
		System.out.println(act);
		String res = mailser.send(act);
		String mes=res=="发送成功"?"发送成功":"发送失败";
		Integer code= res=="发送成功"?200:203;
		return new result(mes,code,res);
	}
}
